phasor: main.c main.h print_string.c cal_file.c serial.c iq_balance.c optimize.c
	gcc -O3 -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -o phasor -lgsl -lgslcblas -ljack -lSDL -lSDL_ttf -lfftw3 -lusb -lm main.c print_string.c cal_file.c serial.c iq_balance.c optimize.c
	if [ -f /usr/bin/etags ] ; then find . -name "*.[chsCHS]" -print | etags - ; fi

cal_test: cal_file.c main.h
	gcc -g -Wall -DTEST -o cal_test -lm cal_file.c

serial_test: serial.c
	gcc -g -Wall -DTEST -DTEST_SIMPLE -o serial_test serial.c

cordic_test: cordic_test.c
	gcc -g -O2 -Wall -lm -o cordic_test cordic_test.c

optimize_test: optimize.c gnuplot_i.c
	gcc -g -O3 -Wall -DTEST -o optimize_test -lgsl -lgslcblas optimize.c gnuplot_i.c

remote_test: remote.c
	gcc -g -O3 -Wall -DTEST -o remote_test remote.c
